package cn.itsource.pethome.org.service.impl;

import cn.itsource.pethome.basic.service.impl.BaseServiceImpl;
import cn.itsource.pethome.org.domain.Department;
import cn.itsource.pethome.org.domain.Employee;
import cn.itsource.pethome.org.mapper.EmployeeMapper;
import cn.itsource.pethome.org.query.EmployeeQuery;
import cn.itsource.pethome.org.service.EmployeeService;
import cn.itsource.pethome.util.AjaxResult;
import cn.itsource.pethome.util.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements EmployeeService {

    /*@Autowired
    private EmployeeMapper employeeMapper;


    @Override
    public List<Employee> loadAll() {
        return employeeMapper.loadAll();
    }

    @Override
    @Transactional
    public void save(Employee employee) {
         employeeMapper.save(employee);
    }

    @Override
    @Transactional
    public void update(Employee employee) {
        employeeMapper.update(employee);
    }

    @Override
    @Transactional
    public void delete(Long id) {
        employeeMapper.delete(id);
    }

    @Override
    @Transactional
    public void batchRemove(List<Long> ids) {
        employeeMapper.batchRemove(ids);
    }
    //查询分页
    @Override
    public PageList<Employee> loadPageByQuery(EmployeeQuery query) {
        Long total = employeeMapper.findCountByQuery(query);
        if (total.equals(0L)){
            return new PageList<Employee>();
        }
        //查询分页列表
        List<Employee> result = employeeMapper.fandListByQuery(query);
        return new PageList<Employee>(total,result);
    }

    @Override
    public Employee loadById(Long id) {
        Employee employee = employeeMapper.loadById(id);
        return employee;
    }*/
}
